﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _11_Generic
{
    internal class Node<T>
    {
        static int index = 0;

        public int Id { get; }
        public T Data { get; set; }
        public Node<T>? Next { get; private set; }

        public Node<T>? left { get;  set; }
        public Node<T>? right { get; set; }

        public Node(T data)
        {
            Id = index++;
            Data = data;
            Next = null;
            left = null;
            right = null;
        }

        public void SetNext(Node<T>? node)
        {
            Next = node;
        }
    }
}
